Examples of conventional data encoding apparatus and data decoding apparatus are shown in FIGS. 1 and 2. In FIG, 1, a video signal is compressed and encoded by video encoder 1 and is inputted to code buffer 4 within multiplexing unit 3. Moreover, a speech signal is compressed and encoded by audio encoder 2, and is inputted to code buffer 5 of the multiplexing unit 3.
Output terminals of code buffers 4, 5 are respectively connected to input terminals E1, E2 of switching circuit 6. Output terminal F of the switching circuit 6 is connected to input terminal of header adding circuit 7. Output of the header adding circuit 7 is delivered to digital data recording unit (DSM) 10 composed of recording medium, e.g., magneto-optical disc or magnetic disc (hard disc), etc., recording/reproducing head and head drive circuit, etc. Control section 8 receives input of system clock that multiplexing system clock generating circuit 9 outputs to sequentially allow input terminals E1, E2 of the switching circuit 6 to be in the state connecting to output terminal F by a predetermined period to sequentially take out data from code buffer 4 or 5 to carry out time-division multiplexing thereof.
The control section 8 controls switching circuit 6 and header adding circuit 7 so that bit stream is generated in accordance with the format shown in FIG. 3
Namely, as shown in FIG. 3, in the multiplexing system of ISO11172 (MPEG), unit (one) multiplexing bit stream is composed of one PACK or more and one ISO.sub.-- 11172.sub.-- end.sub.-- code.sub.--. The ISO.sub.-- 11172.sub.-- end.sub.-- code is code of 32 bits, and is expressed as 0x000001b9 by hexadecimal number. Here, the leading Ox indicates that corresponding code is hexadecimal number (C language).
One pack is composed of header consisting of Pack.sub.-- Start.sub.-- Code, SCR (System Clock Reference) MUX.sub.-- Rate, and one Packet or more. When Pack.sub.-- Start.sub.-- Code of header is code of 32 bits, it is expressed as 0x000001b4 by hexadecimal number. Although the length of a pack is defined as variable length, its length shall now assumed to be fixed to 2048 bytes for simplicity.
One packet is composed of header consisting of Packet.sub.-- Start.sub.-- Code.sub.-- Prefix, stream.sub.-- id, Packet.sub.-- length, PTS (Presentation Time Stamp) and DTS (Decoding Time Stamp), and packet data (Code Data). Packet.sub.-- Start.sub.-- Code.sub.-- Prefix is code of 24 bits and is expressed as 0x000001. stream.sub.-- id is code of 8 bits and indicates kind of packet as shown 1 n FIG. 4. Packet.sub.-- length (16 bits) indicates lengths packets subsequent thereto.
Audio data (in the case of audio stream) or video data (in the case of video stream) is recorded into Code Data of respective packets. Moreover, since audio stream has 32 kinds of different stream-id and video stream has 16 kinds thereof, it is possible to multiplex plural audio and video signals corresponding to the numbers of these kinds at the maximum.
Reserved stream has data, e.g., character, etc. Uses of private.sub.-- stream.sub.-- 1 and private.sub.-- stream.sub.-- 2 are not determined. Padding.sub.-- stream is used for increasing data quantity.
In accordance with the above-mentioned format, control section 8 carries out processing of addition of header and reading of code by using algorithm as shown in FIG. 5, for example, so that interval (length) of the pack becomes equal to 2048 bytes.
First, control section 8 instructs header adding circuit 7 to add pack header (step S1). Then, the control unit 8 waits until sum of M4 and M5 is equal to code data quantity D included within one pack, or is greater than that (step S2). Namely, the control section 8 waits until data contained within one pack is stored into code buffers 4, 5.
Here, M4 is data quantity written in code buffer 4 and M5 is data quantity written in code buffer 5, Moreover, D indicates total quantity of data included within one pack. Now, for simplification, D is assumed to be constant, i,e., value obtained by subtracting size (length) of pack header, size (length) of video packet header and size (length) of audio packet header from size (length) (2048 bytes) of pack,
Then, quantity P1 of video data contained within that pack and quantity P2 of audio data contained within that pack are calculated in accordance with the following formula (step 3). EQU P1=D.times.M4/(M4+M5) EQU P2=D-P1
In the above formula, total quantity D of code data contained within pack is simply allocated (allotted) by ratio between data quantities of respective code buffers 4, 5.
When data quantity is determined, control section 8 instructs header adding circuit 7 to output video packet (step S4). Then, control section 8 reads out video data of P1 bytes from code buffer 4 to output it to DSM 10 (step S5). Similarly, control section 8 adds audio packet header (step S6) to read out audio data of P2 bytes from code buffer 5 to output it to DSM 10 (step S7). In the DSM 10, these input data are recorded onto disc included therein.
The data recorded onto the disc in this way is decoded at data decoding apparatus shown in FIG. 2. Namely, header separating circuit 22 of separating unit 21 separates pack header and packet header from the data which has been read out from DSM 10 to deliver the separated data to control section 24, and to deliver time-division multiplexed data to input terminal G of switching circuit 23. Output terminals H1, H2 of switching circuit 23 are respectively connected to input terminals of video decoder 25 and audio decoder 26. Control section 24 of the separating unit 21 allows input terminal G and output terminals H1 and H2 of the switching circuit 23 to be sequentially in connecting state in accordance with stream.sub.-- id of packet header delivered from header separating circuit 22 to correctly separate the time-division multiplexed data to deliver it to corresponding decoder.
In the case where multiplexed video data is compressed by the encoding system of MPEG in this way, there occurs limitation in random access or search operation. Namely, in MPEG, there are intra-frame coded picture (I (intra) picture), interframe coded picture (P (Predictive) picture), and B (Bidirectionaly predictive) picture). Since encoding of I picture is carried out by using only data within that picture (frame or field), compression efficiency of data becomes lower. Such I picture itself can be decoded. Since P picture and B picture are picture obtained by difference signal from pictures before and after, the compression efficiency of data becomes higher. In order to decode such P picture or B picture, a predictive picture before or after that is required. For this reason, ordinarily, about 2 frames of I picture are caused to occur per second, thus to take balance between random access characteristic and compression efficiency.
Conceptual view of bit stream including I picture, P picture and B picture recorded onto disc by DSM 10 is shown in FIG. 6. A sequence of video bit streams are divided into one GOP (Group of Pictures) or more. GOP has I picture at the leading portion thereof. In the case where compression of fixed rate is being carried out with respect to video data, since I pictures cyclically appear at predetermined positions, corresponding position is determined by calculation, thereby making it possible to provide an access thereto. However, in the case where compression of variable rate is being carried out, position of I picture becomes indefinite. Thus, it is difficult to provide an access.
Namely, in the data decoding apparatus of FIG. 2, in the case where instruction of search is given thereto, main control unit (not shown) instructs video decoder 25 and audio decoder 26 to shift the operation mode to search mode. In the search mode, video decoder 25 decodes only data of I picture from inputted video data. Alternatively, only data of I picture is selected at separating unit 21, and the selected data is inputted to video decoder 25. At the video decoder 25, the inputted data is decoded.
In the search mode, control section 24 instructs DSM 10 to issue command to move read-out position of data on the disc in forward (or backward) direction. While quantity of movement of read-out position at this time is dependent upon speed of search or encoding rate, etc., as speed of search becomes higher, or encoding rate becomes higher, quantity of movement is increased. When read-out position is moved to a predetermined position, data outputted from DSM 10 is inputted to separating unit 21. Header separating circuit 22 separates video data to deliver it to video decoder 25. The video decoder 25 decodes I picture which has appeared first to output it. In the search mode, audio decoder 26 is caused to be placed in mute state.
As stated above, search operation (continuous reproduction of I pictures) is realized as repetition of random access. Namely, in the case where, e.g., high speed search in forward direction is instructed from user, video decoder 25 skips read-out of data of a predetermined number of frames of data inputted thereto to search I picture to decode the I picture to output it. Alternatively, search of I picture is carried out by DSM 10, and only data of I picture is delivered to video decoder 25, at which it is decoded. By repeating such an operation, search operation (continuous reproduction of I pictures) is realized.
As stated above, in the conventional apparatus, since the apparatus cannot recognize position (access point) of I picture, such an operation to move reproduction position to some extent thereafter to wait access point becomes necessary. For this reason, there was the problem that repetition period of search operation becomes long, so rapid (quick) search operation becomes difficult.
This invention has been made in view of such circumstances and contemplates rapidly finding out access point of video data, thus making it possible to carry out quick search at a desired speed.